package com.yonyougov.devops.cruxcisupport.committest;

import com.yonyougov.devops.cruxcisupport.committest.dto.QueryDto;
import com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsCommitTestDto;
import com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsRejectedDto;
import com.yonyougov.devops.cruxcisupport.committest.vo.*;
import com.yonyougov.devops.cruxcisupport.user.UserEntity;
import com.yonyougov.devops.fwc.core.dao.BaseDao;

import java.math.BigInteger;
import java.util.List;

/**
 * 提测表数据层
 */
public interface CommitTestDao extends BaseDao<CommitTestEntity, BigInteger> {


    //<!--用户自定义代码开始-->
    /**
     * 根据提测id查询提测单
     *
     * @param commitTestId 提测id
     * @return CommitTestPageLikeRespVo
     * @date 2020年3月31日11:23:16
     */
    CommitTestPageLikeRespVo findCommitTestByPrimaryKey(BigInteger commitTestId);

    /**
     * 当前用户是开发人员,根据当前用户id获取提测表中的总记录数
     *
     * @param queryListDto com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return int
     */
    int countByDevelop(QueryListDto queryListDto);

    /**
     * 当前用户是开发人员,根据当前用户id获取提测表中的记录
     *
     * @param queryListDto com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return List<CommitTestPageLikeRespVo>
     */
    List<QueryCommitTestVo> findAllByDevelop(QueryListDto queryListDto);

    /**
     * 当前用户是测试人员,根据当前用户id获取提测表中的总记录数
     *
     * @param queryListDto com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return int
     */
    int countByTest(QueryListDto queryListDto);

    /**
     * 当前用户是测试人员,根据当前用户id获取提测表中的记录
     *
     * @param queryListDto com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return List<CommitTestPageLikeRespVo>
     */
    List<QueryCommitTestVo> findAllByTest(QueryListDto queryListDto);

    /**
     * 管理员角色查询
     *
     * @param commitTestPageLikeParamsVo com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return int 记录数
     */
    int countByAdmin(QueryListDto commitTestPageLikeParamsVo);

    /**
     * 管理员角色查询
     *
     * @param commitTestPageLikeParamsVo com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitStartPageDto
     * @return List<CommitTestPageLikeRespVo> java.util.List
     */
    List<QueryCommitTestVo> findAllByAdmin(QueryListDto commitTestPageLikeParamsVo);

    /**
     * 查询测试主管
     * 条件: 提测单id
     *
     * @param commitTestEntity [com.yonyougov.devops.cruxcisupport.committest.CommitTestEntity]
     * @return [com.yonyougov.devops.cruxcisupport.user.UserEntity]
     */
    UserEntity findTestLeadByCommitTestId(CommitTestEntity commitTestEntity);

    /**
     * 今天提测数
     *
     * @return Long
     */
    Long todayCommitTestNumber();

    /**
     * 统计-提测
     *
     * @param statisticsCommitTestDto com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsCommitTestDto
     * @return java.util.List
     */
    List<StatisticsCommitTestVo> statisticsCommitTest(StatisticsCommitTestDto statisticsCommitTestDto);

    /**
     * 统计-提测
     *
     * @param statisticsCommitTestDto com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsCommitTestDto
     * @return java.util.List
     */
    int statisticsCommitTestCount(StatisticsCommitTestDto statisticsCommitTestDto);

    /**
     * 统计-驳回
     *
     * @param statisticsRejectedDto com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsRejectedDto
     * @return java.util.List
     */
    List<StatisticsRejectedVo> statisticsRejected(StatisticsRejectedDto statisticsRejectedDto);

    /**
     * 统计-驳回
     *
     * @param statisticsRejectedDto com.yonyougov.devops.cruxcisupport.committest.dto.StatisticsRejectedDto
     * @return int
     */
    int statisticsRejectedCount(StatisticsRejectedDto statisticsRejectedDto);

    /**
     * 唯一确定一个提测单
     * 条件:提测id或提测code
     *
     * @param queryCommitTestDto com.yonyougov.devops.cruxcisupport.committest.dto.QueryCommitTestDto
     * @return com.yonyougov.devops.cruxcisupport.committest.vo.QueryCommitTestVo
     */
    QueryCommitTestVo queryCommitTest(QueryDto queryCommitTestDto);
    //<!--用户自定义代码结束-->
}
